package controle;

import java.util.GregorianCalendar;

import javax.swing.Timer;



public class Data {
	
	Timer timer;
	GregorianCalendar calendario = new GregorianCalendar();
	String data;
	int ano, mes, dia, horas, minutos, segundos;
	
	public Data(){
		
	}
	
	public int getAno(){
		return ano = calendario.get(GregorianCalendar.YEAR);
	}
	
	public int getMes(){
		return mes = calendario.get(GregorianCalendar.MONTH);
	}
	
	public int getDia(){
		return dia = calendario.get(GregorianCalendar.DAY_OF_MONTH);
	}
	
	public int getHoras() {
		return horas = calendario.get(GregorianCalendar.HOUR_OF_DAY);
	}
	
	public int getMinutos(){
		return minutos = calendario.get(GregorianCalendar.MINUTE);
	}
	
	public int getSegundos(){
		return segundos = calendario.get(GregorianCalendar.SECOND);
	}
	public String getData(){
		int d = getDia();
		int a = getAno();
		int mes = getMes();
		int h = getHoras();
		int m = getMinutos();
		int s = getSegundos();
		data = ((d < 10) ? "0" : "") + d + "" + ((mes < 10) ? "0" : "") + mes + "" + a + "" + 
		((h < 10) ? "0" : "") + h + ":" + ((m < 10) ? "0" : "") + m + ":" + ((s < 10) ? "0" : "") + s + "  ";
		
		return data;
	}
}
